package org.atlantis.grosbeak.lang.filefilter;

import java.io.File;
import java.io.FileFilter;

import org.atlantis.grosbeak.lang.Files;

/**
 * 符合指定拓展名的文件。
 * 
 * @author <a href="mailto:seenoevil.cn@gmail.com">SeeNoEvil</a>
 * 
 */
public class ExtensionFilter implements FileFilter {

	private String[] exts;

	public ExtensionFilter(String... exts) {
		this.exts = exts;
	}

	public boolean accept(File pathname) {
		if (Files.isExtension(pathname.getPath(), exts)
				|| pathname.isDirectory())
			return true;
		return false;
	}
}
